home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1368 / 1368.xpi / chrome / clrtabs.jar / content / clrtabsopt.xul < prev    next >
Extensible Markup Language  |  2009-09-28  |  13KB  |  326 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
  3. <prefwindow    
  4.     id="appPreferences"
  5.     windowtype="window:prefwindow"
  6.     title="Colorful Tabs Options"
  7.     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  8.     xmlns:html="http://www.w3.org/1999/xhtml"
  9.     style="width:300px;"
  10.     onload="document.documentElement.getButton('accept').hidden = false;document.documentElement.getButton('accept').disabled=false;sizeToContent()"
  11.     ondialogaccept="cto.saveDomains();return cto.setSatLum();"
  12.     instantApply="false"
  13.     >
  14.     <prefpane  id="clrtbopt" label="General" style="overflow:visible" onpaneload="cto.clrPrefPaneLoad(event);">
  15.         <preferences>
  16.             <preference id="fadelevel" name="extensions.clrtabs.fadedeg" type="int"/>
  17.             <preference id="scheme" name="extensions.clrtabs.scheme" type="int"/>
  18.             <preference id="clrCtxMenu" name="extensions.clrtabs.menu" type="bool"/>
  19.             <preference id="clrReverse" name="extensions.clrtabs.txtreverse" type="bool"/>
  20.             <preference id="clrBgPic" name="extensions.clrtabs.bgpic" type="bool"/>
  21.             <preference id="standout" name="extensions.clrtabs.standout" type="bool"/>
  22.             <preference id="clrBgPicPath" name="extensions.clrtabs.bgpicpath" type="string"/> 
  23.         </preferences>
  24.  
  25.         <groupbox  align="left"   >
  26.             <caption label="Coloring Scheme"   />
  27.  
  28.             <radiogroup id="clrPrefs" preference="scheme">
  29.                 <radio id="clr1" label="Use Default Palette." value="0" />
  30.                 <radio id="clr2" label="Generate Colors At Random." value="1" />
  31.                 <radio id="clr3" label="Generate Colors By Domain Hostname." value="2" />
  32.                 <radio id="clr4" label="Color On Demand (No Color By Default, Right Click Tab And Set Color Manually)." value="3" />
  33.             </radiogroup>
  34.         </groupbox>
  35.         <groupbox  align="left"   >
  36.         <caption label="Selected Tab"   />             
  37.              
  38.              
  39.              <hbox><label>Fading Level</label>
  40.             <menulist id="fadedeg" preference="fadelevel">
  41.                 <menupopup>
  42.                 <menuitem label="0 (No tab fading)" value="0"/>
  43.                 <menuitem label="1 (minimum)" value="1"/>
  44.                 <menuitem label="2" value="2"/>
  45.                 <menuitem label="3" value="3"/>
  46.                 <menuitem label="4" value="4"/>
  47.                 <menuitem label="5" value="5"/>
  48.                 <menuitem label="6" value="6"/>
  49.                 <menuitem label="7" value="7"/>
  50.                 <menuitem label="8" value="8"/>
  51.                 <menuitem label="9 (maximum)" value="9"/>
  52.                 <!-- <menuitem label="10 (max, hardly visible)" value="10" style="color:red"/> -->
  53.                 </menupopup>
  54.             </menulist></hbox>
  55.              
  56.             <hbox>            
  57.                 <checkbox id="standoutcheck"  preference="standout" label="Highlight the currently selected tab."/>
  58.             </hbox>
  59.         </groupbox>
  60.         <groupbox  align="left"   >
  61.         <caption label="Miscellaneous"  />
  62.         <checkbox id="clrCtxMenu" label="Enable context menu on the tabs." preference="clrCtxMenu" />    
  63.         <checkbox id="clrReverse" label="Reverse the text color on the tabs." preference="clrReverse" title="If the tab text becomes unreadable you may want to check this."/>
  64.         <checkbox id="clrTabBgnd"  preference="clrBgPic"  label="Enable a background image for tabs."  oncommand="document.getElementById('image-path').disabled=!this.checked;document.getElementById('browseBgnd').disabled=!this.checked"   />
  65.         <textbox id="image-path" style="width:100%"   preference="clrBgPicPath"  /> 
  66.         <button label="Browse..." oncommand="cto.browsebgnd();" id="browseBgnd"  /> 
  67.         <label class="text-link" onclick="ct.wOpen('http://www.binaryturf.com/?page_id=514')" value="Get background images" title="Get an smart stripe to use for tabs background."/>
  68.         </groupbox>
  69.     </prefpane>
  70. <prefpane id="domainclrs"  
  71.      label="Presets"        
  72.     orient="vertical"
  73.     onpaneload="setDomainPref();changeUI(document.getElementById('denabled'),0);"
  74.     >
  75.     <preferences>
  76.         <preference id="enabledomain" name="extensions.clrtabs.enabledomain" type="bool" /> 
  77.     </preferences>
  78.  
  79. <groupbox disabled="true"  align="left"  >
  80.     <caption label="Preset Domain Colors"   />
  81.     
  82.     <vbox pack="center">
  83.             <label value="See Documentation" onclick="window.opener.getBrowser().selectedTab=window.opener.getBrowser().addTab('http://www.binaryturf.com/free-software/colorfultabs-for-firefox/colorfultabs-documentation-and-help/'); "  class="textLink" style="color:blue;cursor:hand !important;" />
  84.         <label>To delete a domain, blank it out and save.</label>
  85.           </vbox>
  86.  
  87.     <checkbox id="denabled" label="Enable Preset Domain Colors" preference="enabledomain" 
  88.     oncommand="changeUI(this,1)" />
  89.  
  90.     <grid  style="height:200px; overflow-y:auto;"  > 
  91.         <columns>
  92.                   <column flex="1"/>
  93.                   <column flex="1"/>
  94.             <column flex="1"/>
  95.             </columns>
  96.         <rows id="domainrows"   >
  97.             <row><label value="Domain" flex="1"/><label value="Color" flex="1"/><label value="Color Picker" flex="1"/></row>
  98.         </rows>
  99.     </grid>
  100.     <button id="adddomain" label="Add Domain" oncommand="addDomain();"/>
  101. </groupbox>
  102. </prefpane>
  103.  
  104. <!--  -->
  105. <!--  -->
  106. <!--  -->
  107. <!--  -->
  108.     <prefpane id="advOpt"  label="Color Fine-Tuning" style="overflow:visible" onpaneload="cto.advPrefInit();">
  109.         <preferences>
  110.             <preference id="adv" name="extensions.clrtabs.advanced" type="bool"/>
  111.             <preference id="satmin" name="extensions.clrtabs.satmin" type="int"/>
  112.             <preference id="satmax" name="extensions.clrtabs.satmax" type="int"/>
  113.             <preference id="lummax" name="extensions.clrtabs.lummax" type="int"/>
  114.             <preference id="lummin" name="extensions.clrtabs.lummin" type="int"/>
  115.             <!-- <preference id="clrCtxMenu" name="extensions.clrtabs.menu" type="bool"/> -->
  116.             <!-- <preference id="stripBkgnd" name="extensions.clrtabs.stripclr" type="string"/> -->
  117.             <preference id="sat" name="extensions.clrtabs.sat" type="int"/>
  118.             <preference id="lum" name="extensions.clrtabs.lum" type="int"/>
  119.         </preferences>
  120.  
  121.     <groupbox  align="left"   >
  122.         <caption label="Colour Fine-Tuning Options"   />
  123.         <checkbox label="Enable Fine-Tuning Options" id='advenable' preference='adv' oncommand="cto.adv_toggle_state(this.checked);" />
  124.         <groupbox id='adv_group'  collapsed="true">
  125.             <caption label="Saturation and Luminance for Random Coloring"  />
  126.             <grid>
  127.                 <rows>
  128.                     <row>
  129.                         <label />
  130.                         <label value="Minimum" />
  131.                         <label value="Maximum" />
  132.                     </row>
  133.                     <row>
  134.                         <label value="Saturation%" />
  135.                         <textbox id='satmin' maxlength='3' size='3'  style='border:1px inset silver;' oninput='cto.val(this)' preference='satmin'/>
  136.                         <textbox id='satmax' maxlength='3' size='3'  style='border:1px inset silver;' oninput='cto.val(this)' preference='satmax'/>
  137.                     </row>
  138.                     <row>
  139.                         <label value="Luminance%" />
  140.                         <textbox id='lummin' maxlength='3' size='3'  style='border:1px inset silver;' oninput='cto.val(this)' preference='lummin'/>
  141.                         <textbox id='lummax' maxlength='3' size='3'  style='border:1px inset silver;' oninput='cto.val(this)' preference='lummax'/>
  142.                     </row>
  143.                 </rows>
  144.             </grid>
  145.             <button label="Reset" oncommand="cto.resetPref()"/>
  146.         </groupbox>
  147.         <groupbox id='adv_group2' collapsed="true">
  148.             <caption label="Saturation and Luminance for Domain based coloring"  />
  149.             <grid>
  150.                 <rows>
  151.                      
  152.                     <row>
  153.                         <label value="Saturation%" />
  154.                         <textbox id='sat' maxlength='3' size='3'  style='border:1px inset silver;' oninput='cto.val(this)' preference='sat'/>
  155.                         
  156.                     </row>
  157.                     <row>
  158.                         <label value="Luminance%" />
  159.                         <textbox id='lum' maxlength='3' size='3'  style='border:1px inset silver;' oninput='cto.val(this)' preference='lum'/>
  160.                         
  161.                     </row>
  162.                 </rows>
  163.             </grid>
  164.             <button label="Reset" oncommand="cto.resetPref()"/>
  165.         </groupbox>
  166.  
  167.  
  168.  
  169.  
  170.     </groupbox>
  171.     
  172.     </prefpane>
  173.     <prefpane
  174.         id="cthelp"
  175.         label="Help"        
  176.         
  177.     >
  178.      <groupbox     >
  179.         <caption label="Help and Resources"   />
  180.         <vbox>
  181.             <label class="text-link" style="cursor:pointer" tooltiptext="Visit Help and Documentation" onclick="ct.wOpen('http://www.binaryturf.com/free-software/colorfultabs-for-firefox/colorfultabs-documentation-and-help/');">Help and Documentation</label>             
  182.             <label class="text-link" style="cursor:pointer" tooltiptext="Visit the support forums" onclick="ct.wOpen('http://forums.binaryturf.com/')">Support Forums</label>             
  183.             <label class="text-link" style="cursor:pointer" tooltiptext="Visit Extension Homepage" onclick="ct.wOpen('http://www.binaryturf.com/')">Extension's Homepage</label>
  184.             <label class="text-link" style="cursor:pointer" tooltiptext="Visit QuickStart Guide" onclick="ct.wOpen('http://colorfultabs.binaryturf.com/')">ColorfulTabs Quick-Start Guide</label>
  185.         </vbox>
  186.     </groupbox>
  187.      <groupbox  >
  188.         <caption label="Help us help you"   />              
  189.              <vbox style="min-height:200px">
  190.             <label style="font-family:'Times New Roman',Times,Georgia,serif;font-size:1.5em;font-style:italic" tooltiptext="Donate to ColorfulTabs" >We hope you've had great experience with ColorfulTabs and find it useful. If it is so please do consider donating to ColorfulTabs. </label>
  191.              <hbox>
  192.             <image src="chrome://clrtabs/content/donate.png" style="width:165px;height:65px;cursor:pointer;" onclick="ct.wOpen('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2633620/')" />
  193.             </hbox>
  194.              </vbox>
  195.     </groupbox>
  196. </prefpane>
  197. <script type="application/x-javascript">
  198. <![CDATA[
  199. function addDomain()
  200.     {
  201.     //alert(document.getElementsByAttribute("rel","domain").length)
  202.     var i = document.getElementsByAttribute("rel","domain").length;
  203.         a = document.createElement('row');
  204.         
  205.         b =  document.createElement('textbox');
  206.         b.setAttribute("id","domain"+i);
  207.         b.setAttribute("rel","domain");
  208.  
  209.         bb =document.createElement('textbox');    
  210.         bb.setAttribute("id","clrTxt"+i);
  211.         bb.setAttribute("rel","color");
  212.  
  213.         c =  document.createElement('colorpicker');             
  214.         c.setAttribute("id","clrPkr"+i);
  215.         c.setAttribute("type","button")
  216.         c.setAttribute("palettename","standard")
  217.         d =  "document.getElementById('clrTxt"+i+"').value=this.color"
  218.         c.setAttribute("onchange",d)
  219.  
  220.         a.appendChild(b)
  221.         a.appendChild(bb)
  222.         a.appendChild(c)
  223.         document.getElementById("domainrows").appendChild(a)
  224.     }
  225. function changeUI(el,prompt)
  226.     {
  227.     //cl("el.checked"+el.checked)
  228.     elsd = document.getElementById('domainrows').getElementsByAttribute("rel","domain");
  229.     elsc = document.getElementById('domainrows').getElementsByAttribute("rel","color");
  230.     elsk = document.getElementById('domainrows').getElementsByTagName("colorpicker");
  231.     var clrScheme =  Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("extensions.clrtabs.").getIntPref("scheme");
  232.     
  233.     if(!el.checked || (clrScheme != 2))    
  234.         {
  235.         if(prompt && clrScheme != 2)
  236.             {
  237.             alert("Please select \"Generate colors by Domain hostname\" under \"General\".")
  238.             el.removeAttribute("checked");
  239.             }
  240.         for(i=0;i<elsd.length;i++)
  241.             {
  242.             elsd[i].setAttribute("disabled","true");
  243.             elsc[i].setAttribute("disabled","true");
  244.             elsk[i].setAttribute("disabled","true");
  245.             }
  246.         
  247.         }
  248.     else
  249.         {
  250.         for(i=0;i<elsd.length;i++)
  251.             {
  252.             elsd[i].removeAttribute("disabled");
  253.             elsc[i].removeAttribute("disabled");
  254.             elsk[i].removeAttribute("disabled");
  255.             }
  256.         //document.getElementById('domainrows').style.visibility ="visible" ;
  257.         }
  258.     }
  259. function setDomainPref() 
  260.     {
  261.     
  262.     
  263.     /*
  264.     document.getElementById('d1').disabled = !el.checked;
  265.     document.getElementById('d2').disabled = !el.checked;
  266.     document.getElementById('d3').disabled = !el.checked;
  267.     document.getElementById('d4').disabled = !el.checked;
  268.     document.getElementById('d5').disabled = !el.checked;
  269.     */
  270.     var a,b,c,bb,d,domain,color;
  271.      
  272.     var dpref = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("extensions.clrtabs.").getCharPref("dpref");
  273.     dpref= dpref.split("`");
  274.     for(i = 0 ; i < dpref.length ; i++)
  275.         {
  276.         domain = dpref[i].split("~")[0]
  277.         color =dpref[i].split("~")[1];
  278.         a = document.createElement('row');
  279.         b =  document.createElement('textbox');
  280.             //b.setAttribute("id","d"+i)
  281.             b.setAttribute("value",domain);
  282.             b.setAttribute("id","domain"+i);
  283.             b.setAttribute("rel","domain");
  284.  
  285.         
  286.         bb =document.createElement('textbox');                //<textbox id="clrvalue"   size="7" oninput="setClr();" value="#" />
  287.         bb.setAttribute("value",color)
  288.         bb.setAttribute("id","clrTxt"+i);
  289.         bb.setAttribute("rel","color");
  290.  
  291.         c =  document.createElement('colorpicker');
  292.              
  293.             c.setAttribute("id","clrPkr"+i);
  294.             c.setAttribute("color",color);
  295.             c.setAttribute("type","button")
  296.             //d = "setTxtClr("    +    i    +    ")"
  297.             d =  "document.getElementById('clrTxt"+i+"').value=this.color"
  298.             c.setAttribute("palettename","standard")
  299.             
  300.             c.setAttribute("onchange",d)
  301.             
  302.              
  303.         a.appendChild(b)
  304.         a.appendChild(bb)
  305.         a.appendChild(c)
  306.         document.getElementById("domainrows").appendChild(a)
  307.         }
  308.     
  309.     }
  310. function setTxtClr(id)
  311.     {
  312.      var clr = document.getElementById("clrPkr"+id).color;
  313.      
  314.      document.getElementById("clrTxt"+id).value = clr;
  315.       document.getElementById("clrPkr"+id).color = clr;
  316.     }
  317.  
  318.  
  319.  
  320.     ]]>
  321. </script>
  322. <script type="application/x-javascript" src="chrome://clrtabs/content/adv.js" />
  323. <script type="application/x-javascript" src="chrome://clrtabs/content/clrtabs.js"/>
  324.  
  325. </prefwindow>
  326.